cmake_minimum_required(VERSION 3.16.3)
project(tiny_redis_server_cmake)

set(CMAKE_CXX_STANDARD 20)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
set(ASIO_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/asio/include)

add_executable(tiny_redis_server_cmake main.cpp)
add_subdirectory(src/server)
target_compile_options(tiny_redis_server_cmake PUBLIC -DASIO_STANDALONE)
#target_compile_options(tiny_redis_server_cmake PUBLIC -DASIO_HAS_IO_URING)
#target_compile_options(tiny_redis_server_cmake PUBLIC -DASIO_DISABLE_EPOLL)
#target_compile_options(tiny_redis_server_cmake PUBLIC -DASIO_HAS_CO_AWAIT)

target_include_directories(tiny_redis_server_cmake PUBLIC ${ASIO_INCLUDE})
find_package(Threads REQUIRED)
target_link_libraries(tiny_redis_server_cmake Threads::Threads)
target_link_libraries(tiny_redis_server_cmake redis_server)